#include <omp.h>
#include <iostream>

using namespace std;

int main(int argc, char** argv){
  int nthreads, tid;
  int N = 10;
  double a[N], b[N];
  int chunk = 1; 
  
  for(int i = 0; i < N; i++)
    a[i] = (double)i;

#pragma omp parallel \
  shared(N,nthreads, a, b, chunk) \
  private(tid)
  {
    tid = omp_get_thread_num();
    cerr << "Thread " << tid << " starting.. " << endl;
#pragma omp for schedule(static)
    for(int i = 0; i < N; i++){
      b[i] = 2.0 * a[i];
      cerr << "Thread " << tid << " calculating b[" << i << "]" << endl;
    }

  }
  
//  for(i = 0; i < N; i++){
//    printf("b[%d] = %f\n", i, b[i]);
//  }

}
